<template>
	<div class="sort_value_wrapper">
		<p class="title">{{ title }}</p>
		<el-input-number v-model="numValue" :min="min" :max="max"></el-input-number>
	</div>
</template>

<script>
export default {
	props: {
		value: { type: Number, default: null },
		title: { type: String, default: '' },
		min: { type: Number, default: 1 },
		max: { type: Number, default: 10 }
	},
	data() {
		return {
			numValue: this.value
		};
	},
	watch: {
		value(val) {
			this.numValue = val;
		},
		numValue(val) {
			this.$emit('input', val);
		}
	}
};
</script>

<style lang="scss" scoped>
.sort_value_wrapper::v-deep {
	p.title {
		color: #606266;
		font-size: 14px;
		margin-bottom: 10px;
	}
	.el-input-number {
		width: 100%;
	}
}
</style>
